package com.example.tossednfound;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

/**
 * The Regular User Home Screen
 */

public class RegHomeActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_reg_home);
		findViewById(R.id.home_foundButton).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
						CreateEntryActivity.entryType = 0; // found item
						Intent createEntryActivity =  new Intent("android.intent.action.CREATEENTRYACTIVITY");
						startActivity(createEntryActivity);
					}
				});
		findViewById(R.id.home_lostButton).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
						CreateEntryActivity.entryType = 1; // lost item
						Intent createEntryActivity =  new Intent("android.intent.action.CREATEENTRYACTIVITY");
						startActivity(createEntryActivity);
					}
				});
		findViewById(R.id.home_donateButton).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
						CreateEntryActivity.entryType = 2; // donation
						Intent createEntryActivity =  new Intent("android.intent.action.CREATEENTRYACTIVITY");
						startActivity(createEntryActivity);
					}
				});
		findViewById(R.id.home_browse_items).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View view) {
						Intent createEntryActivity =  new Intent("android.intent.action.ITEMLISTVIEWACTIVITY");
						startActivity(createEntryActivity);
					}
				});
	}

	@Override
	protected void onPause() {
		super.onPause();
		finish();
	}

	@Override
	public void onBackPressed() {
		super.onBackPressed();
		Intent loginActivity =  new Intent("android.intent.action.LOGINACTIVITY");
		startActivity(loginActivity);
	}
	
	
	
}
